﻿@model BussinessLogic.Exercise.ExerciseProtocol
@{
    ViewBag.Title = "ExerciseMaintain";
    Layout = null;
    int i;
}
<!DOCTYPE html>
<html>
<head>
    <title>ExerciseSession</title>
    <style type="text/css">
        .photoDisplay
        {
            position: absolute;
        }
        
        .feedback
        {
            color:Blue;
            font-weight:bolder;
            font-size: 46px;
            background-color:Black;
        }
    </style>
    <script type="text/javascript">
        var pictureTime = @Model.PictureTime;
        var digitTime = @Model.CrossNumberTime;
        var baselineTrials = @Model.AcomodationTrials;
        var needFinalSession = @(Model.FinalSession ? "true" : "false");

        var trials = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model.Trials));
        
    </script>
</head>
<body style="background-color: Black">
    @using (Html.BeginForm())
    {
        
        <div id="container">
            <div id="feedback" class="feedback"></div>
            <div id="photoDisplay" class="photoDisplay">
                <img id="upBackground" src="@Url.Content("~/uploads/background.png")" alt="" />
                <img id="upE" src="@Url.Content("~/uploads/e.png")" alt="" style="display:none"/>
                <img id="upF" src="@Url.Content("~/uploads/f.png")" alt="" style="display:none"/>
                @{ i = 0;}
                @foreach (var trial in Model.Trials)
                {
                    if (trial.NeutralPosition == BussinessLogic.Exercise.ExerciseTrial.Position.Up)
                    {
                    <img id="@("upPhoto_" + i++)" src="@Url.Content("~/uploads/neutral/" + trial.NeutralPhoto)" alt="" style="display:none"/>    
                    }
                    else
                    {
                        if (trial.SType == BussinessLogic.Exercise.ExerciseTrial.SequenceType.Fixation)
                        {
                    <img id="@("upPhoto_" + i++)" src="" alt="" style="display:none"/>            
                        }
                        else if (!trial.NegativeNeutral)
                        {
                    <img id="@("upPhoto_" + i++)" src="@Url.Content("~/uploads/negative/" + trial.NegativePhoto)" alt="" style="display:none"/>            
                        }
                        else
                        {
                    <img id="@("upPhoto_" + i++)" src="@Url.Content("~/uploads/neutral/" + trial.NegativePhoto)" alt="" style="display:none"/>    
                        }
                    }

                }
                <div style="text-align: center; height: 30px; vertical-align: middle">
                    <span id="picSeparator" style="color: Red; font-weight: bolder">+</span>
                </div>
                <img id="downBackground" src="@Url.Content("~/uploads/background.png")" alt="" />
                <img id="downE" src="@Url.Content("~/uploads/e.png")" alt="" style="display:none"/>
                <img id="downF" src="@Url.Content("~/uploads/f.png")" alt="" style="display:none"/>
                @{i = 0;}
                @foreach (var trial in Model.Trials)
                {
                    if (trial.NeutralPosition == BussinessLogic.Exercise.ExerciseTrial.Position.Down)
                    {
                    <img id="@("downPhoto_" + i++)" src="@Url.Content("~/uploads/neutral/" + trial.NeutralPhoto)" alt="" style="display:none"/>    
                    }
                    else
                    {
                        if (trial.SType == BussinessLogic.Exercise.ExerciseTrial.SequenceType.Fixation)
                        {
                    <img id="@("upPhoto_" + i++)" src="" alt="" style="display:none"/>            
                        }
                        else if (!trial.NegativeNeutral)
                        {
                    <img id="@("downPhoto_" + i++)" src="@Url.Content("~/uploads/negative/" + trial.NegativePhoto)" alt="" style="display:none"/>            
                        }
                        else
                        {
                    <img id="@("downPhoto_" + i++)" src="@Url.Content("~/uploads/neutral/" + trial.NegativePhoto)" alt="" style="display:none"/>    
                        }
                    }
                }
            </div>
        </div>
        <input id="jsonResult" type="text" name="jsonResult" style="display: none" />
    }
</body>
<script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.19.min.js")" type="text/javascript"></script>
<link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />
<script src="../../Scripts/Protocol/ExerciseProtocol.js" type="text/javascript"></script>
</html>
